<?php
// +----------------------------------------------------------------------
// | HisiPHP框架[基于ThinkPHP5.1开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2021 http://www.hisiphp.com
// +----------------------------------------------------------------------
// | HisiPHP承诺基础框架永久免费开源，您可用于学习和商用，但必须保留软件版权信息。
// +----------------------------------------------------------------------
// | Author: 橘子俊 <364666827@qq.com>，开发者QQ群：50304283
// +----------------------------------------------------------------------

namespace app\home\controller;

use app\common\controller\Backend;
use app\home\model\SystemLog as LogModel;

/**
 * 日志管理控制器
 * @package app\system\admin
 */
class Log extends Backend
{
    protected $hsModel = 'SystemLog';

    /**
     * @title 获取 bug/需求 操作记录 status 0 = 需求，1 = bug
     * @description 接口说明
     * @author
     * @url /log/getLog/:id
     * @method POST
     */
    public function getLog($id)
    {
        if ($this->request->isPost()) {
            $status = $this->request->param('status');
            $log = $this->model()->where(['need_id' => $id, 'status' => $status])->order('ctime','desc')->select();
            return json(['code' => 0, 'msg' => 'success', 'data' => $log]);
        }
    }
}
